package com.probiz.estore.common.model.cart;

import java.io.Serializable;

import com.probiz.estore.common.model.cart.base.ShoppingcartPromotionTbl;

/**
 * Model class for ShoppingcartPromotion. Add not database mapped fileds in this class.
 */
public class ShoppingcartPromotion extends ShoppingcartPromotionTbl implements Serializable {

	private static final long serialVersionUID = -8365135630280628340L;
	/**
	 * 该促销活动是否优惠券促销
	 */
	private Short isUsedCoupon = Shoppingcart.ISUSECOUPON_NO;
	// 使用的优惠券号码
	private String usedCouponNo;
	/**
	 * 促销类型 参考 PromoRule.PROMOTION_TYPE_SHOPPINGCARTPROMOTION等等
	 */
	private String type;

	/**
	 * Default Empty Constructor for class ShoppingcartPromotion
	 */
	public ShoppingcartPromotion() {
		super();
	}

	/**
	 * Default Key Fields Constructor for class ShoppingcartPromotion
	 */
	public ShoppingcartPromotion(Integer in_shoppingcartPromotionId) {
		super(in_shoppingcartPromotionId);
	}

	public int hashCode() {
		final int prime = 31;
		int result = prime * 8 + ((promoRuleId == null) ? 0 : promoRuleId.hashCode());

		return result;
	}

	public boolean equals(Object obj) {
		if(null == obj)return false;
		if (this == obj)return true;
		if (getClass() != obj.getClass())
			return false;
		final ShoppingcartPromotion other = (ShoppingcartPromotion) obj;
		if (promoRuleId == null) {
			if (other.promoRuleId != null)
				return false;
		} else if (!promoRuleId.equals(other.promoRuleId))
			return false;

		return true;
	}

	public Short getIsUsedCoupon() {
		return isUsedCoupon;
	}

	public void setIsUsedCoupon(Short isUsedCoupon) {
		this.isUsedCoupon = isUsedCoupon;
	}

	public String getUsedCouponNo() {
		return usedCouponNo;
	}

	public void setUsedCouponNo(String usedCouponNo) {
		this.usedCouponNo = usedCouponNo;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

}
